package com.ny.demo519;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ViewMain {
    public static void main(String[] args) {
        boolean flag = true;
        TestList testList = new TestList();
        List<Emp>list = new ArrayList<>();
        while (flag){
            testList.menu();
            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
            switch (n){
                case 0:
                    System.out.println("推出系统");
                    flag = false;
                    break;
                case 1:
                    System.out.println("添加员工界面");
                    System.out.println("请输入员工信息");
                    System.out.println("请输入员工编号");
                    String number = scanner.next();
                    System.out.println("请输入员工姓名");
                    String name = scanner.next();
                    System.out.println("请输入员工年龄");
                    int age = scanner.nextInt();
                    Emp emp = new Emp(number, name, age);
                    testList.addEmp(list, emp);
                    System.out.println(list);
                    break;
                case 2:
                    System.out.println("来到查询所有员工信息的界面");
                    testList.findAllEmp(list);
                    break;
                case 3:
                    System.out.println("来到根据查询所有员工信息的界面");
                    System.out.println("请输入员工的名字");
                    String findName = scanner.next();
                    testList.findEmpName(list, findName);
                    break;
                case 4:
            }
        }
    }
}